#ifndef CHATMESSAGE_H
#define CHATMESSAGE_H

#include <QRect>
#include <QString>

class CChatMessage {
public:
    enum MessageType{
        System,     // 系统消息
        Me,         // 我发出的消息
        Other,      // 别人发的消息
        Time        // 时间消息
    };

public:
    CChatMessage();

    inline QString time() {return m_time;}
    inline MessageType userType() {return m_msgType;}

    virtual QSize GetSize(void);
    virtual void SetContext(const QString& str);
    virtual const QString& GetContext(void) const;

protected:
    QString m_time;
    QString m_curTime;

    int m_nFrameWidth;
    int m_textWidth;
    int m_spaceWid;
    int m_nLineHeight;

    QString m_strContext;

    MessageType m_msgType;


};

#endif // CHATMESSAGE_H
